{%include file="m.index.header.tpl.php"%}
<!--头部 end-->
<!--主体部分-->
<div class="container" style="margin-top:70px;margin-left:2%;margin-right:2%">
    <div class="row">
        <section class="content-header">
            <h1>
                邮箱
                <small>13 新消息</small>
            </h1>

        </section>
        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-md-3">
                    <a href="mailbox.html" class="btn btn-primary btn-block margin-bottom">返回收件箱</a>

                    <div class="box box-solid">
                        <div class="box-header with-border">
                            <h3 class="box-title">文件夹</h3>

                            <div class="box-tools">
                                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                                </button>
                            </div>
                        </div>
                        <div class="box-body no-padding">
                            <ul class="nav nav-pills nav-stacked">
                                <li class="active"><a href="index.php?a=mail.list&type=inbox"><i class="fa fa-inbox"></i> 收件箱 <span class="label label-primary pull-right">{%$count%}</span></a></li>
                                <li><a href="index.php?a=mail.list&type=outbox"><i class="fa fa-envelope-o"></i> 发件箱</a></li>
                                <!--  <li><a href="#"><i class="fa fa-file-text-o"></i> 草稿</a></li>-->

                                <li><a href="index.php?a=mail.list&type=spambox"><i class="fa fa-trash-o"></i> 垃圾箱</a></li>
                            </ul>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <!-- /. box -->

                </div>
                <!-- /.col -->
                <div class="col-md-9">
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">写邮件</h3>
                        </div>
                        <!-- /.box-header -->
                        <form name="myform" method="post" action=""  enctype="multipart/form-data">
                        <div class="box-body">
                            <div class="form-group">
                                <input name="mail_to" id="staff_name" type="text" class="form-control" value="{%$mail_data.mail_fromname%}" autocomplete="off" placeholder="收件人:">
                                <input name="mail_to" id="staff_id" type="hidden" class="form-control" value="{%$mail_data.mail_from%}">

                            </div>
                            <div class="form-group">
                                <input name="mail_title" value="{%$mail_title%}" class="form-control" placeholder="主题:">
                            </div>
                            <div class="form-group">
                                <textarea id="mail_content" name="mail_content" rows="22" cols="40" style="width: 100%">{%$mail_content%}</textarea>
                            </div>
                            {%if $mail_data.mail_file!=""%}
                            <div class="box-footer">
                                <ul class="mailbox-attachments clearfix">
                                    {%foreach from=$mail_data.mail_file key=key item=value%}
                                    <li>

                                        <div class="mailbox-attachment-info">
                                            <a href="index.php?a=mail.file&mail_id={%$mail_id%}&fname={%$value.fname%}" class="mailbox-attachment-name"><i class="fa fa-paperclip"></i> {%$value.fname%}</a>
                                            <span class="mailbox-attachment-size">
                          {%$value.fsize%} KB
                          <a href="index.php?a=mail.file&mail_id={%$mail_id%}&fname={%$value.fname%}" class="btn btn-default btn-xs pull-right"><i class="fa fa-cloud-download"></i></a>
                        </span>
                                        </div>
                                    </li>
                                    {%/foreach%}
                                </ul>
                            </div>
                            {%else%}

                            <div class="form-group" style="padding-left:10px;">
                                <div class="btn btn-default btn-file">
                                    <i class="fa fa-paperclip"></i> 附件
                                    <input type="file" name="mail_file" >
                                </div>
                                <p class="help-block">最大不要超过32MB</p>
                            </div>
                            {%/if%}
                        </div>
                        <!-- /.box-body -->
                        <div class="box-footer">
                            <div class="pull-right">
                                <input type="hidden" name="MAX_FILE_SIZE" value="40960000">
                                <button type="submit" class="btn btn-primary"><i class="fa fa-envelope-o"></i> 发送</button>
                            </div>
                            <button type="reset" class="btn btn-default"><i class="fa fa-times"></i> 取消</button>
                        </div>
                        <!-- /.box-footer -->
                            </form>
                    </div>
                    <!-- /. box -->
                </div>
                <!-- /.col -->
            </div>
            <!-- /.row -->
        </section>
        <!-- /.content -->

    </div><!--row  end-->
</div><!--container  end-->
<!--主体部分  end-->
<!--底部-->
{%include file="m.index.footer.tpl.php"%}


<!--底部end-->
<script type="text/javascript" src="mstatic/js/jquery.min.js"></script>
<script src="mstatic/js/icheck.min.js"></script><!--邮箱-->

<!--编辑器-->
<script type="text/javascript" src="mstatic/xhe/xheditor-1.2.2.min.js"></script>
<script type="text/javascript" src="mstatic/xhe/xheditor_lang/zh-cn.js"></script>

<script src="mstatic/js/run_prettify.js"></script>
<script src="mstatic/js/jquery.mockjax.js"></script>
<script src="mstatic/js/bootstrap-typeahead.js"></script>
<script type="text/javascript">
    $(pageInit);
    function pageInit()
    {
        $.extend(XHEDITOR.settings,{shortcuts:{'ctrl+enter':submitForm}});//修改默认设置
        $('#mail_content').xheditor({modalWidth:700,modalHeight:500,upBtnText:'浏览',upLinkUrl:"!ckfinder/upload.html",upImgUrl:"!ckfinder/upload.html?type=Images",upFlashUrl:"!ckfinder/upload.html?type=Flash",upMediaUrl:"!ckfinder/upload.html"});
    }
    function submitForm(){$('#myform').submit();}<!-- Page Script -->
</script>
<script>
    $(function() {
        function displayResult(item) {
            $("#staff_id").val(item.value);
            if(item.value > 0){
                //window.location.href="index.php?a=staff.subjectupdate&staff_id="+item.value;
            }
        }
        $('#staff_name').typeahead({
            source: [
                {%foreach from=$staff_lists key=key item=value%}
        { id: {%$value.staff_id%}, name: '{%$value.staff_name%}' },
        {%/foreach%}
        ],

        onSelect: displayResult,
    });

    });
</script>

<script>
    $(function () {
        //Enable iCheck plugin for checkboxes
        //iCheck for checkbox and radio inputs
        $('.mailbox-messages input[type="checkbox"]').iCheck({
            checkboxClass: 'icheckbox_flat-blue',
            radioClass: 'iradio_flat-blue'
        });

        //Enable check and uncheck all functionality
        $(".checkbox-toggle").click(function () {
            var clicks = $(this).data('clicks');
            if (clicks) {
                //Uncheck all checkboxes
                $(".mailbox-messages input[type='checkbox']").iCheck("uncheck");
                $(".fa", this).removeClass("fa-check-square-o").addClass('fa-square-o');
            } else {
                //Check all checkboxes
                $(".mailbox-messages input[type='checkbox']").iCheck("check");
                $(".fa", this).removeClass("fa-square-o").addClass('fa-check-square-o');
            }
            $(this).data("clicks", !clicks);
        });

        //Handle starring for glyphicon and font awesome
        $(".mailbox-star").click(function (e) {
            e.preventDefault();
            //detect type
            var $this = $(this).find("a > i");
            var glyph = $this.hasClass("glyphicon");
            var fa = $this.hasClass("fa");

            //Switch states
            if (glyph) {
                $this.toggleClass("glyphicon-star");
                $this.toggleClass("glyphicon-star-empty");
            }

            if (fa) {
                $this.toggleClass("fa-star");
                $this.toggleClass("fa-star-o");
            }
        });
    });
</script>
<script src="mstatic/js/jQuery-2.2.0.min.js" type="text/javascript"></script>
<!-- Bootstrap 3.3.6 -->
<script src="mstatic/js/bootstrap.min.js" type="text/javascript"></script>

<script src="mstatic/js/app.js" type="text/javascript"></script>
<!-- iCheck -->
<script src="mstatic/js/icheck.min.js" type="text/javascript"></script>

<script type="text/javascript" src="mstatic/xhe/xheditor-1.2.2.min.js"></script>
<script type="text/javascript" src="mstatic/xhe/xheditor_lang/zh-cn.js"></script>

<script type="text/javascript">
    $(pageInit);
    function pageInit()
    {
        $.extend(XHEDITOR.settings,{shortcuts:{'ctrl+enter':submitForm}});//修改默认设置
        $('#category_content').xheditor({modalWidth:700,modalHeight:500,upBtnText:'浏览',upLinkUrl:"!ckfinder/upload.html",upImgUrl:"!ckfinder/upload.html?type=Images",upFlashUrl:"!ckfinder/upload.html?type=Flash",upMediaUrl:"!ckfinder/upload.html"});
    }
    function submitForm(){$('#myform').submit();}
</script>
</body>
</html>
